#include<stdio.h>

void sort( int a[], int n )
{
    int boo = 1,temp;
    for (;boo == 1;)
    {
        boo = 0;
        for (int i = 0; i < n - 1; i++)
        {
            if (*(a+i)>*(a+i+1))
            {
                temp = *(a+i);
                *(a+i) = *(a+i+1);
                *(a+i+1) = temp;
                boo = 1;
            }
            
        }
    }

}





int main(){    int i, n;

    scanf("%d",&n);    int a[n];
    for( i=0; i<n; i++ )        scanf("%d", &a[i]);

    sort(a, n);    printf("After sorted the array is:");    for( i = 0; i < n; i++ )        printf(" %d", a[i]);    printf("\n");    return 0;
}
